﻿Imports Microsoft.DirectX
Public Class LandschaftstexturPipeline
    Inherits ObjektLandschaftsTextur
    ''' <summary>
    ''' 0=   1=+N   2=+N+O   3=+N+S   4=+N+O+S   5=+N+O+S+W
    ''' </summary>
    ''' <remarks></remarks>
    Dim UebergangsMeshs(5) As Objekt3D


    Public Sub New()
        ID = "PIPELINE"
        Landschaftsname = "Pipeline"
        Deckung = 0
        Tarnung = False
        KP = -1
        TexturenLaden(New String() {"Pipeline+O+W", "Pipeline+N+W", "Pipeline+N+O", "Pipeline+N+S", "Pipeline+O+S", "Pipeline+S+W", "Pipeline+W", "Pipeline+O", "Pipeline+N", "Pipeline+S", "Pipeline+N+O+S", "Pipeline+O+S+W", "Pipeline+N+S+W", "Pipeline+N+O+W", "Pipeline+N+O+S+W"})
        Normal = 0
        Ausrichtungslandschaften = New String() {"PIPELINE", "SCHWEISSNAHT", "KAPUTTESCHWEISSNAHT", "PLINEKAPUTT", "PLINE", "PIPE", "PIPESCHWEISS", "KAPUTTEPIPESCHWEISS", "PLINESCHWEISS", "PIPESTATION", "FABRIK"}

        If DataSettings.draw3D Then
            Ini3D()
        End If
    End Sub

    Public Overrides Function DrawSpecialStyle(ByVal BildID As Integer, ByVal Fog As Nebelarten, ByVal Alpha As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal TerrainUntergrundID As Integer, ByVal TerrainUntergrundBildID As Integer, ByVal TerrainUntergrundID2 As Integer, ByVal TerrainUntergrundBildID2 As Integer, Optional ByVal FixedLocation As Boolean = False, Optional ByVal Top As Boolean = False) As Boolean
        Return DrawTerrainUndUntergrund(Alpha, Fog, BildID, X, Y, 0, 0, TerrainUntergrundID, TerrainUntergrundBildID, TerrainUntergrundID2, TerrainUntergrundBildID2, FixedLocation, Top)
    End Function

    Public Overrides Function GetTerrainUntergrund() As String()
        Return New String() {"EBENE", "SCHNEE", "WUESTE"}
    End Function

    Public Overrides Sub Malen3D(ByVal p_MatCube As Microsoft.DirectX.Matrix, ByVal Landschaft As ObjektLandschaft)
        'Ganz normal eine Ebene als Untergrund malen.
        Malen3D(p_MatCube, "EBENE", Landschaft)
        'Pipeline Mesh malen
        Dim ind As Integer = 0
        Dim Rot As Single = 0
        Dim Ausr As String = AusrichtungVereinfachen(getAusrichtung(Landschaft.KooX, Landschaft.KooY, Objektverwalter.Spielfeld), Rot)
        Select Case Ausr
            Case ""
                ind = 0
            Case "+N"
                ind = 1
            Case "+N+O"
                ind = 2
            Case "+N+S"
                ind = 3
            Case "+N+O+S"
                ind = 4
            Case "+N+O+S+W"
                ind = 5
        End Select
        Dim Mat As Matrix = Matrix.RotationY(Rot)
        Mat.M41 = p_MatCube.M41 + 0.5
        Mat.M42 = p_MatCube.M42
        Mat.M43 = p_MatCube.M43 + 0.5
        UebergangsMeshs(ind).Malen(Mat)
    End Sub

    Public Overrides Sub Ini3D()
        UebergangsMeshs(0) = New Objekt3D()
        UebergangsMeshs(1) = New Objekt3D()
        UebergangsMeshs(2) = New Objekt3D()
        UebergangsMeshs(3) = New Objekt3D()
        UebergangsMeshs(4) = New Objekt3D()
        UebergangsMeshs(5) = New Objekt3D()
        UebergangsMeshs(0).MeshBildLaden(DataSettings.Resourcenpfad + "Terrain\Meshes\Pipeline.x")
        UebergangsMeshs(1).MeshBildLaden(DataSettings.Resourcenpfad + "Terrain\Meshes\Pipeline+N.x")
        UebergangsMeshs(2).MeshBildLaden(DataSettings.Resourcenpfad + "Terrain\Meshes\Pipeline+N+O.x")
        UebergangsMeshs(3).MeshBildLaden(DataSettings.Resourcenpfad + "Terrain\Meshes\Pipeline+N+S.x")
        UebergangsMeshs(4).MeshBildLaden(DataSettings.Resourcenpfad + "Terrain\Meshes\Pipeline+N+O+S.x")
        UebergangsMeshs(5).MeshBildLaden(DataSettings.Resourcenpfad + "Terrain\Meshes\Pipeline+N+O+S+W.x")
    End Sub

    Public Overrides Sub Tick()

    End Sub
End Class
Public Class LandschaftstexturPipe
    Inherits ObjektLandschaftsTextur



    Public Sub New()
        ID = "PIPE"
        Landschaftsname = "Pipeline"
        Deckung = 0
        Tarnung = False
        KP = -1
        TexturenLaden(New String() {"Pipe+O+W", "Pipe+N+W", "Pipe+N+O", "Pipe+N+S", "Pipe+O+S", "Pipe+S+W", "Pipe+W", "Pipe+O", "Pipe+N", "Pipe+S", "Pipe+N+O+S", "Pipe+O+S+W", "Pipe+N+S+W", "Pipe+N+O+W", "Pipe+N+O+S+W"})
        Normal = 0
        Ausrichtungslandschaften = New String() {"PIPELINE", "SCHWEISSNAHT", "KAPUTTESCHWEISSNAHT", "PLINEKAPUTT", "PLINE", "PIPE", "PIPESCHWEISS", "KAPUTTEPIPESCHWEISS", "PLINESCHWEISS", "PIPESTATION", "FABRIK"}
    End Sub

    Public Overrides Function DrawSpecialStyle(ByVal BildID As Integer, ByVal Fog As Nebelarten, ByVal Alpha As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal TerrainUntergrundID As Integer, ByVal TerrainUntergrundBildID As Integer, ByVal TerrainUntergrundID2 As Integer, ByVal TerrainUntergrundBildID2 As Integer, Optional ByVal FixedLocation As Boolean = False, Optional ByVal Top As Boolean = False) As Boolean
        Return DrawTerrainUndUntergrund(Alpha, Fog, BildID, X, Y, 0, 0, TerrainUntergrundID, TerrainUntergrundBildID, TerrainUntergrundID2, TerrainUntergrundBildID2, FixedLocation, Top)
    End Function

    Public Overrides Function GetTerrainUntergrund() As String()
        Return New String() {"WUESTE", "SCHNEE", "EBENE"}
    End Function

    Public Overrides Sub Malen3D(ByVal p_MatCube As Microsoft.DirectX.Matrix, ByVal Landschaft As ObjektLandschaft)

    End Sub

    Public Overrides Sub Ini3D()

    End Sub

    Public Overrides Sub Tick()

    End Sub
End Class
Public Class LandschaftstexturPline
    Inherits ObjektLandschaftsTextur



    Public Sub New()
        ID = "PLINE"
        Landschaftsname = "Pipeline"
        Deckung = 0
        Tarnung = False
        KP = -1
        TexturenLaden(New String() {"PLINE+O+W", "PLINE+S+W", "PLINE+O+S", "PLINE+O+S+W", "PLINE+N+W", "PLINE+N+S", "PLINE+N+S+W", "PLINE+N+O", "PLINE+N+O+W", "PLINE+N+O+S", "PLINE+N", "PLINE+O", "PLINE+S", "PLINE+W", "PLINE+N+O+S+W"})
        Normal = 0
        Ausrichtungslandschaften = New String() {"PIPELINE", "SCHWEISSNAHT", "KAPUTTESCHWEISSNAHT", "PLINEKAPUTT", "PLINE", "PIPE", "PIPESCHWEISS", "KAPUTTEPIPESCHWEISS", "PLINESCHWEISS", "PIPESTATION", "FABRIK"}
    End Sub

    Public Overrides Function DrawSpecialStyle(ByVal BildID As Integer, ByVal Fog As Nebelarten, ByVal Alpha As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal TerrainUntergrundID As Integer, ByVal TerrainUntergrundBildID As Integer, ByVal TerrainUntergrundID2 As Integer, ByVal TerrainUntergrundBildID2 As Integer, Optional ByVal FixedLocation As Boolean = False, Optional ByVal Top As Boolean = False) As Boolean
        Return DrawTerrainUndUntergrund(Alpha, Fog, BildID, X, Y, 0, 0, TerrainUntergrundID, TerrainUntergrundBildID, TerrainUntergrundID2, TerrainUntergrundBildID2, FixedLocation, Top)
    End Function

    Public Overrides Function GetTerrainUntergrund() As String()
        Return New String() {"SCHNEE", "EBENE", "WUESTE"}
    End Function

    Public Overrides Sub Malen3D(ByVal p_MatCube As Microsoft.DirectX.Matrix, ByVal Landschaft As ObjektLandschaft)

    End Sub

    Public Overrides Sub Ini3D()

    End Sub

    Public Overrides Sub Tick()

    End Sub
End Class
